<?php 
		
	function send_email($to_email,$mbr){

		$data['member_id'] = $mbr;//最近添加的数据id
		$data['keys_id'] = md5($to_email);//加密的注册账号信息
		$data['cookie_time'] = time()+300;//激活有效时间
	    add('active',$data);
	   header("content-type:text/html;charset=utf-8");
	   // ini_set("magic_quotes_runtime()",0);
	   // require 'class.phpmailer.php';
	   require LIB_PATH.'./PHPMailer/PHPMailerAutoload.php';
	   require LIB_PATH.'./PHPMailer/class.phpmailer.php';
	   try {
		   $mail = new PHPMailer(true);//创建一个邮件发送类对象

		   $mail ->IsSMTP();//表示以SMTP协议发送邮件
		   $mail ->CharSet='utf-8';  //设置邮件的字符编码，这很重要，不然中文乱码
		   $mail ->SMTPAuth      = true;  //开启认证
		   $mail ->Port          = 25;        //邮件发送服务端口 固定 
		   $mail ->Host          = "SMTP.163.com"; //服务器地址，此为163邮箱服务器
		   $mail ->Username      ="lingyang8586@163.com"; //发送人账号
		   $mail ->Password      ="ly198810"; //发送人授权码

		   $mail ->AddReplyTo("lingyang8586@163.com","yang");//回复地址 参数1：回复人地址 参数2：昵称
		   $mail ->From          ="lingyang8586@163.com";//发件人邮箱地址
		   $mail ->FromName      ="阳仔";//发件人昵称

	       // $to                   = "lingyang8586@163.com";//接收人账号
	       $mail->AddAddress($to_email);//接收人账号
	       $mail->Subject        ="注册账号激活";//邮箱标题
	       $to_email = md5($to_email);
		   $mail->Body = "请点击邮箱内提供的激活链接实现账号激活操作。<a href='https://localhost/cms/index.php?c=member&a=active&keys=$to_email'>https://localhost/cms/index.php?c=member&a=active&keys=$to_email</a>"; //邮件内容 

		   $mail->IsHTML(true); //以html格式发送
		   // $mail->Send();//发送邮件
		   // echo '邮件已发送';
		   if($mail->Send()){
				echo 1;

		   }
		 } catch (phpmailerException $e){
		 	echo "邮件发送失败：".$e->errormessage();
		 }

	}
